using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class HomePanel : PanelCommon
{
    public Text name;
    public Text birthYear;
    public Text xingzuo;
    public Text location;
    public Text job;
    public Text eduation;
    public Text height;
    public Text weight;
    public Text income;

    public void Init(HomeVCData data)
    {
        name.text = data.name;
        birthYear.text = data.birthYear.ToString();
        xingzuo.text = data.xingzuo;
        location.text = data.location;
        job.text = data.job;
        eduation.text = data.edu;
        height.text = data.height+"cm";
        weight.text = data.weight + "kg";
        income.text = $"${data.income} / y";
    }

    public void Edit()
    {
        
    }

    protected override void GoBackToView()
    {
        base.GoBackToView();

        GoBackToBattleUI();
    }
    
    bool m_ToHide;
    void GoBackToBattleUI()
    {
        if (m_ToHide)
            return;

        m_ToHide = true;

        GetComponentInParent<MBattleSceneController>().ShowBattleUI();
    }
    // Update is called once per frame
    void Update()
    {
        
    }

}
